package com.github.cyf.rateLimit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 漏桶算法
 * @author chenyifan
 * @create 2025-02-05 10:41
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface LeakyBucketRateLimit {

    /**
     * 桶的容量
     * @return
     */
    int capacity() default 100;

    /**
     * 漏斗的速率，单位：秒
     * @return
     */
    int leakRate() default 30;

}